package com.bdd.Enum;

public enum RoleEnum {

    ADMIN(1, "店长"),
    STAFF(2, "店员");

    private Integer id;

    private String cnName;

    RoleEnum(Integer i, String n) {
        id = i;
        cnName = n;
    }

   public  static Integer getIdByName(String name){
        for(RoleEnum roleEnum:RoleEnum.values()){
            if(roleEnum.name().equals(name))return roleEnum.getId();
        }
        return null;
    }

    public Integer getId(){
        return id;
    }

}
